
package com.jair.apicommon.model;

import lombok.Data;
import java.io.Serializable;

@Data
public class InterfaceResponse implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private String result;
    private String message;
    private Integer code;
    private Long timestamp;
    
    public static InterfaceResponse success(String result) {
        InterfaceResponse response = new InterfaceResponse();
        response.setResult(result);
        response.setCode(200);
        response.setMessage("success");
        response.setTimestamp(System.currentTimeMillis());
        return response;
    }
    
    public static InterfaceResponse error(String message) {
        InterfaceResponse response = new InterfaceResponse();
        response.setCode(500);
        response.setMessage(message);
        response.setTimestamp(System.currentTimeMillis());
        return response;
    }
}